<?php 
class Cookie{
	private $_cookie;
	public function setCookie($user, $key, $exp){
		$text = $user . '/' . $key . '/' . $exp;
		$hash = $user . $key;
		$cookie = $text . '|' . $hash;

		$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
		$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
		$this->_cookie = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $cookie, MCRYPT_MODE_ECB, $iv);
		setcookie('login',$this->_cookie, time()+ $exp);

	}

	public function desCookie(){
	}
}